package com.song.utils;


import java.sql.Timestamp;
import java.util.Date;

/**Date 与 Timestamp 互转
 * @author song
 */
public class TransformUtil {
    /**
     * Date 转 Timestamp
     * @return Timestamp
     */
    public static Timestamp getTimestamp(){
        return new Timestamp(System.currentTimeMillis());
    }

    /**
     * Timestamp 转 Date
     * @return Date
     */
    public static Date getDate(){
        Timestamp t = new Timestamp(System.currentTimeMillis());
        return new Date(t.getTime());
    }

}
